# Maintainer:
pkgname=gtk4-layer-shell
pkgver=1.0.2
pkgrel=0
pkgdesc="Create panels and other desktop components in Wayland using the Layer Shell protocol in GTK4"
url="https://github.com/wmww/gtk4-layer-shell"
arch="all"
license="MIT"
makedepends="
	gobject-introspection-dev
	gtk4.0-dev
	meson
	vala
	wayland-dev
	wayland-protocols
	"
checkdepends="
	font-dejavu
	py3-gobject3
	xvfb-run
	"
subpackages="$pkgname-dev $pkgname-demo"
source="$pkgname-$pkgver.tar.gz::https://github.com/wmww/gtk4-layer-shell/archive/v$pkgver.tar.gz
	no-lua-test.patch
	"

prepare() {
	default_prepare

	rm -fv test/smoke-tests/test-lua-example.py
}

build() {
	abuild-meson \
		-Db_lto=true \
		-Dexamples=true \
		-Ddocs=false \
		-Dtests="$(want_check && echo true || echo false)" \
		. output
	meson compile -C output
}

check() {
	XDG_RUNTIME_DIR="$(mktemp -d -p "$builddir")" \
		xvfb-run -a \
		meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

demo() {
	pkgdesc="Demo of GTK4 Layer Shell"

	amove usr/bin/gtk4-layer-demo
}

sha512sums="
f43a75c20fa41e4bc44430a36cf60a01281ce67a19afb4ed8297633a91803394ba8fe14dfb81db46f5bccc3e3dfe1474175b6c3249cfa614b42b167329b279f3  gtk4-layer-shell-1.0.2.tar.gz
d581a80a98a701d6ff7cd5555f0b1a7959efb91b72f54e3ba597f78b2094d3f5630f8d96249860c761fee927a271ee624a192edb9bd40e2884f2004136e545ed  no-lua-test.patch
"
